home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Utilities / GOCR / src / Makefile < prev    next >
Makefile  |  2000-05-29  |  4KB  |  155 lines

  1. #
  2. # please modify following lines, if you use another compiler
  3. #
  4. VPath=gocr_0_2
  5. CC=gcc
  6. # debug flags
  7. DFLAGS= -pedantic
  8. CFLAGS= -xc++ -O0 $(DFLAGS) -Wall -pipe -g -ansi # -v (debug)
  9. LIB= -g # -lm -static
  10. INC=
  11. SRC=c
  12. #
  13. # include config
  14. # Options are: 
  15. #        -r all tgz untgz zip clean install tar dist check test archiv
  16. #
  17. # send bug-reports to jschulen@altmark.nat.uni-magdeburg.de
  18.  
  19. CFILES = pgm2asc.cc jconv.cc pnm.cc pcx.cc tga.cc ocr0.cc ocr1.cc
  20. OFILES = pgm2asc.o  jconv.o  pnm.o  pcx.o  tga.o  ocr0.o  ocr1.o
  21. FILES = $(CFILES) Makefile *.h README README.DE font?.tex text.tex ocr.tex *.html
  22.  
  23. # export all make-variables to submakes
  24. #export # geht nicht auf iris!
  25.  
  26. # Format of a make Description File Entry
  27. # The general form of an entry is:
  28. # target1 [target2..]:[:] [parent1..][; command]...
  29. # [(tab) commands]
  30. #
  31. # Translating everything:
  32.  
  33. .SUFFIXES: .o .cc .pgm .asc
  34. .cc.o:
  35.     $(CC) $(CFLAGS) -c -o $*.o $<
  36. .pgm.asc: a.out
  37.     ./a.out -i $*.pgm
  38.  
  39. # nur erste Regel oder optional angegebene Regel wird ausgefuehrt!!!
  40. #all:  gocr.tgz gocr
  41. all:    gocr jconv
  42. #    @echo "make gocr    # make ocr-exe"
  43. #    @echo "make jconv    # convert pnm pcx and tga"
  44. #       @echo "make database"   # create database (LaTeX,gs needed)
  45.  
  46. jconv: jconv.o pnm.o pcx.o tga.o
  47.     $(CC) -o jconv jconv.o pnm.o pcx.o tga.o
  48.  
  49. gocr.tgz: $(FILES)
  50.     tar -cf - $(FILES) | gzip -c >gocr.tgz
  51.  
  52. ocr.tar.Z: $(FILES)
  53.     tar -cf - $(FILES) | compress -c >ocr.tar.Z
  54.  
  55. .PHONY : zip
  56. zip:
  57.     zip -k -q ocr.zip $(FILES)
  58.     @ls -al ocr.zip
  59.  
  60. database:
  61.     sh create_db
  62.     
  63.  
  64. /* ======== dependencies ========== */
  65. jconv.o: pnm.h pcx.h tga.h
  66. pgm2asc.o: pnm.h ocr0.h ocr1.h pcx.h tga.h
  67. ocr0.o: pgm2asc.h
  68. ocr1.o: pgm2asc.h
  69. pcx.o: pcx.h
  70. tga.o: tga.h
  71.  
  72. .PHONY : install
  73. install: a.out fonts
  74.     @$(MAKE) -f Makefile a.out
  75.  
  76. gocr: pgm2asc.o pnm.o pcx.o tga.o ocr0.o ocr1.o
  77.     $(CC) -o gocr pgm2asc.o pnm.o pcx.o tga.o ocr0.o ocr1.o $(LIB)
  78.     @echo "---   ./gocr is now installed    ---"
  79.  
  80. font.tex: font1.tex
  81.     cp font1.tex font.tex
  82.  
  83. font.dvi: font.tex
  84.     latex font.tex
  85.  
  86. font.ps: font.dvi
  87.     dvips -E -o font.ps font.dvi    # -PAPERSIZE=a4
  88.  
  89. text.dvi: text.tex
  90.     latex text.tex
  91.  
  92. text.ps: text.dvi
  93.     dvips -E -o text.ps text.dvi    # -PAPERSIZE=a4
  94.  
  95. # dummerweise macht gs immer a4 aus boxed-ps => reduce picture
  96. # gs options: pgmraw, pcxmono, laserjet
  97. font1.pbm: font.ps jconv Makefile
  98.     gs -dNOPAUSE -q -r300 -sDEVICE=pbmraw \
  99.      -sOutputFile=font1.pbm - < font.ps
  100.     ./jconv -shrink -pbm font1.pbm font1.pbm 0 0 0 0
  101.  
  102. font2.pbm: font.ps jconv Makefile 
  103.     gs -dNOPAUSE -q -r150 -sDEVICE=pbmraw \
  104.      -sOutputFile=font2.pbm - < font.ps
  105.     ./jconv -shrink -pbm font2.pbm font2.pbm 0 0 0 0
  106.  
  107. text.pbm: text.ps jconv Makefile
  108.     gs -dNOPAUSE -q -r150 -sDEVICE=pbmraw \
  109.      -sOutputFile=text.pbm - < text.ps
  110.     ./jconv -shrink -pbm text.pbm text.pbm 0 0 0 0
  111.  
  112. # change this to make a man page to a test.pbm file
  113. man.pbm: jconv Makefile
  114.     man -Tdvi man >man.dvi
  115.     dvips -o man.ps man.dvi
  116.     gs -dNOPAUSE -q -r300 -sDEVICE=pbmraw \
  117.      -sOutputFile=man.pbm - < man.ps
  118.     ./jconv -shrink -pbm man.pbm man.pbm 0 0 0 0
  119.     rm -f man.ps man.dvi
  120.  
  121. fonts: font1.pbm font2.pbm
  122.  
  123. font.lj: font.ps        # for scanner
  124.     gs -dNOPAUSE -q -r300 -sDEVICE=laserjet \
  125.      -sOutputFile=font.lj - < font.ps
  126.  
  127.  
  128. .PHONY : tgz dist
  129. dist: tgz
  130. tgz: clean
  131.     -rm -f gocr jconv
  132.     (cd ..;tar --exclude=$(VPath)/tmp -cf - $(VPath) | gzip -c >gocr.tgz)
  133.     @ls -al ../gocr.tgz
  134.  
  135. .PHONY : archiv
  136. archiv: gocr.tgz
  137. #    cp gocr.tgz gocr`date +%y%m%d`.tgz        # yymmdd
  138. #    cp gocr.tgz gocr`date +%Y%j`.tgz        # YYyyDDD D=day_of_year
  139. #    @ls -al *.tgz
  140.  
  141. .PHONY : untgz
  142. untgz:                            # since 1998-139
  143.      gzip -d -c gocr.tgz | tar -xf -
  144.  
  145. # PHONY = don't look at file clean, -rm = start rm and ignore errors
  146. .PHONY : clean
  147. clean:
  148.     -rm -f $(OFILES)
  149.     -rm -f *.aux *.log *.dvi *.ps *.lj *~
  150. #    rm old versions
  151.     -rm -f convert.cc convert convert.o
  152.  
  153.  
  154.  
  155.